3.59 \(\int (f+g x)^2 (A+B \log (e (\frac {a+b x}{c+d x})^n)) \, dx\)
Optimal. Leaf size=157 \[ \frac {(f+g x)^3 \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{3 g}-\frac {B n (b f-a g)^3 \log (a+b x)}{3 b^3 g}-\frac {B g n x (b c-a d) (-a d g-b c g+3 b d f)}{3 b^2 d^2}-\frac {B g^2 n x^2 (b c-a d)}{6 b d}+\frac {B n (d f-c g)^3 \log (c+d x)}{3 d^3 g} \]
[Out]
-1/3*B*(-a*d+b*c)*g*(-a*d*g-b*c*g+3*b*d*f)*n*x/b^2/d^2-1/6*B*(-a*d+b*c)*g^2*n*x^2/b/d-1/3*B*(-a*g+b*f)^3*n*ln(
b*x+a)/b^3/g+1/3*(g*x+f)^3*(A+B*ln(e*((b*x+a)/(d*x+c))^n))/g+1/3*B*(-c*g+d*f)^3*n*ln(d*x+c)/d^3/g
________________________________________________________________________________________
Rubi [A] time = 0.18, antiderivative size = 157, normalized size of antiderivative = 1.00,
number of steps used = 4, number of rules used = 3, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used =
{2525, 12, 72} \[ \frac {(f+g x)^3 \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{3 g}-\frac {B g n x (b c-a d) (-a d g-b c g+3 b d f)}{3 b^2 d^2}-\frac {B n (b f-a g)^3 \log (a+b x)}{3 b^3 g}-\frac {B g^2 n x^2 (b c-a d)}{6 b d}+\frac {B n (d f-c g)^3 \log (c+d x)}{3 d^3 g} \]
Antiderivative was successfully verified.
[In]
Int[(f + g*x)^2*(A + B*Log[e*((a + b*x)/(c + d*x))^n]),x]
[Out]
-(B*(b*c - a*d)*g*(3*b*d*f - b*c*g - a*d*g)*n*x)/(3*b^2*d^2) - (B*(b*c - a*d)*g^2*n*x^2)/(6*b*d) - (B*(b*f - a
*g)^3*n*Log[a + b*x])/(3*b^3*g) + ((f + g*x)^3*(A + B*Log[e*((a + b*x)/(c + d*x))^n]))/(3*g) + (B*(d*f - c*g)^
3*n*Log[c + d*x])/(3*d^3*g)
Rule 12
Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] && !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]
Rule 72
Int[((e_.) + (f_.)*(x_))^(p_.)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Int[ExpandIntegrand[(
e + f*x)^p/((a + b*x)*(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IntegerQ[p]
Rule 2525
Int[((a_.) + Log[(c_.)*(RFx_)^(p_.)]*(b_.))^(n_.)*((d_.) + (e_.)*(x_))^(m_.), x_Symbol] :> Simp[((d + e*x)^(m
+ 1)*(a + b*Log[c*RFx^p])^n)/(e*(m + 1)), x] - Dist[(b*n*p)/(e*(m + 1)), Int[SimplifyIntegrand[((d + e*x)^(m +
1)*(a + b*Log[c*RFx^p])^(n - 1)*D[RFx, x])/RFx, x], x], x] /; FreeQ[{a, b, c, d, e, m, p}, x] && RationalFunc
tionQ[RFx, x] && IGtQ[n, 0] && (EqQ[n, 1] || IntegerQ[m]) && NeQ[m, -1]
Rubi steps
\begin {align*} \int (f+g x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \, dx &=\frac {(f+g x)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{3 g}-\frac {(B n) \int \frac {(b c-a d) (f+g x)^3}{(a+b x) (c+d x)} \, dx}{3 g}\\ &=\frac {(f+g x)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{3 g}-\frac {(B (b c-a d) n) \int \frac {(f+g x)^3}{(a+b x) (c+d x)} \, dx}{3 g}\\ &=\frac {(f+g x)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{3 g}-\frac {(B (b c-a d) n) \int \left (\frac {g^2 (3 b d f-b c g-a d g)}{b^2 d^2}+\frac {g^3 x}{b d}+\frac {(b f-a g)^3}{b^2 (b c-a d) (a+b x)}+\frac {(d f-c g)^3}{d^2 (-b c+a d) (c+d x)}\right ) \, dx}{3 g}\\ &=-\frac {B (b c-a d) g (3 b d f-b c g-a d g) n x}{3 b^2 d^2}-\frac {B (b c-a d) g^2 n x^2}{6 b d}-\frac {B (b f-a g)^3 n \log (a+b x)}{3 b^3 g}+\frac {(f+g x)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{3 g}+\frac {B (d f-c g)^3 n \log (c+d x)}{3 d^3 g}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.15, size = 146, normalized size = 0.93 \[ \frac {(f+g x)^3 \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )-\frac {B n \left (b^2 d^2 g^3 x^2 (b c-a d)+2 b d g^2 x (b c-a d) (-a d g-b c g+3 b d f)+2 d^3 (b f-a g)^3 \log (a+b x)-2 b^3 (d f-c g)^3 \log (c+d x)\right )}{2 b^3 d^3}}{3 g} \]
Antiderivative was successfully verified.
[In]
Integrate[(f + g*x)^2*(A + B*Log[e*((a + b*x)/(c + d*x))^n]),x]
[Out]
((f + g*x)^3*(A + B*Log[e*((a + b*x)/(c + d*x))^n]) - (B*n*(2*b*d*(b*c - a*d)*g^2*(3*b*d*f - b*c*g - a*d*g)*x
+ b^2*d^2*(b*c - a*d)*g^3*x^2 + 2*d^3*(b*f - a*g)^3*Log[a + b*x] - 2*b^3*(d*f - c*g)^3*Log[c + d*x]))/(2*b^3*d
^3))/(3*g)
________________________________________________________________________________________
fricas [B] time = 0.96, size = 334, normalized size = 2.13 \[ \frac {2 \, A b^{3} d^{3} g^{2} x^{3} + {\left (6 \, A b^{3} d^{3} f g - {\left (B b^{3} c d^{2} - B a b^{2} d^{3}\right )} g^{2} n\right )} x^{2} + 2 \, {\left (3 \, B a b^{2} d^{3} f^{2} - 3 \, B a^{2} b d^{3} f g + B a^{3} d^{3} g^{2}\right )} n \log \left (b x + a\right ) - 2 \, {\left (3 \, B b^{3} c d^{2} f^{2} - 3 \, B b^{3} c^{2} d f g + B b^{3} c^{3} g^{2}\right )} n \log \left (d x + c\right ) + 2 \, {\left (3 \, A b^{3} d^{3} f^{2} - {\left (3 \, {\left (B b^{3} c d^{2} - B a b^{2} d^{3}\right )} f g - {\left (B b^{3} c^{2} d - B a^{2} b d^{3}\right )} g^{2}\right )} n\right )} x + 2 \, {\left (B b^{3} d^{3} g^{2} x^{3} + 3 \, B b^{3} d^{3} f g x^{2} + 3 \, B b^{3} d^{3} f^{2} x\right )} \log \relax (e) + 2 \, {\left (B b^{3} d^{3} g^{2} n x^{3} + 3 \, B b^{3} d^{3} f g n x^{2} + 3 \, B b^{3} d^{3} f^{2} n x\right )} \log \left (\frac {b x + a}{d x + c}\right )}{6 \, b^{3} d^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((g*x+f)^2*(A+B*log(e*((b*x+a)/(d*x+c))^n)),x, algorithm="fricas")
[Out]
1/6*(2*A*b^3*d^3*g^2*x^3 + (6*A*b^3*d^3*f*g - (B*b^3*c*d^2 - B*a*b^2*d^3)*g^2*n)*x^2 + 2*(3*B*a*b^2*d^3*f^2 -
3*B*a^2*b*d^3*f*g + B*a^3*d^3*g^2)*n*log(b*x + a) - 2*(3*B*b^3*c*d^2*f^2 - 3*B*b^3*c^2*d*f*g + B*b^3*c^3*g^2)*
n*log(d*x + c) + 2*(3*A*b^3*d^3*f^2 - (3*(B*b^3*c*d^2 - B*a*b^2*d^3)*f*g - (B*b^3*c^2*d - B*a^2*b*d^3)*g^2)*n)
*x + 2*(B*b^3*d^3*g^2*x^3 + 3*B*b^3*d^3*f*g*x^2 + 3*B*b^3*d^3*f^2*x)*log(e) + 2*(B*b^3*d^3*g^2*n*x^3 + 3*B*b^3
*d^3*f*g*n*x^2 + 3*B*b^3*d^3*f^2*n*x)*log((b*x + a)/(d*x + c)))/(b^3*d^3)
________________________________________________________________________________________
giac [B] time = 5.58, size = 3346, normalized size = 21.31 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((g*x+f)^2*(A+B*log(e*((b*x+a)/(d*x+c))^n)),x, algorithm="giac")
[Out]
1/6*(2*(3*B*b^4*c^2*d^2*f^2*n - 6*B*a*b^3*c*d^3*f^2*n - 6*(b*x + a)*B*b^3*c^2*d^3*f^2*n/(d*x + c) + 3*B*a^2*b^
2*d^4*f^2*n + 12*(b*x + a)*B*a*b^2*c*d^4*f^2*n/(d*x + c) + 3*(b*x + a)^2*B*b^2*c^2*d^4*f^2*n/(d*x + c)^2 - 6*(
b*x + a)*B*a^2*b*d^5*f^2*n/(d*x + c) - 6*(b*x + a)^2*B*a*b*c*d^5*f^2*n/(d*x + c)^2 + 3*(b*x + a)^2*B*a^2*d^6*f
^2*n/(d*x + c)^2 - 3*B*b^4*c^3*d*f*g*n + 3*B*a*b^3*c^2*d^2*f*g*n + 9*(b*x + a)*B*b^3*c^3*d^2*f*g*n/(d*x + c) +
3*B*a^2*b^2*c*d^3*f*g*n - 15*(b*x + a)*B*a*b^2*c^2*d^3*f*g*n/(d*x + c) - 6*(b*x + a)^2*B*b^2*c^3*d^3*f*g*n/(d
*x + c)^2 - 3*B*a^3*b*d^4*f*g*n + 3*(b*x + a)*B*a^2*b*c*d^4*f*g*n/(d*x + c) + 12*(b*x + a)^2*B*a*b*c^2*d^4*f*g
*n/(d*x + c)^2 + 3*(b*x + a)*B*a^3*d^5*f*g*n/(d*x + c) - 6*(b*x + a)^2*B*a^2*c*d^5*f*g*n/(d*x + c)^2 + B*b^4*c
^4*g^2*n - B*a*b^3*c^3*d*g^2*n - 3*(b*x + a)*B*b^3*c^4*d*g^2*n/(d*x + c) + 3*(b*x + a)*B*a*b^2*c^3*d^2*g^2*n/(
d*x + c) + 3*(b*x + a)^2*B*b^2*c^4*d^2*g^2*n/(d*x + c)^2 - B*a^3*b*c*d^3*g^2*n + 3*(b*x + a)*B*a^2*b*c^2*d^3*g
^2*n/(d*x + c) - 6*(b*x + a)^2*B*a*b*c^3*d^3*g^2*n/(d*x + c)^2 + B*a^4*d^4*g^2*n - 3*(b*x + a)*B*a^3*c*d^4*g^2
*n/(d*x + c) + 3*(b*x + a)^2*B*a^2*c^2*d^4*g^2*n/(d*x + c)^2)*log((b*x + a)/(d*x + c))/(b^3*d^3 - 3*(b*x + a)*
b^2*d^4/(d*x + c) + 3*(b*x + a)^2*b*d^5/(d*x + c)^2 - (b*x + a)^3*d^6/(d*x + c)^3) - (6*B*b^6*c^3*d*f*g*n - 18
*B*a*b^5*c^2*d^2*f*g*n - 12*(b*x + a)*B*b^5*c^3*d^2*f*g*n/(d*x + c) + 18*B*a^2*b^4*c*d^3*f*g*n + 36*(b*x + a)*
B*a*b^4*c^2*d^3*f*g*n/(d*x + c) + 6*(b*x + a)^2*B*b^4*c^3*d^3*f*g*n/(d*x + c)^2 - 6*B*a^3*b^3*d^4*f*g*n - 36*(
b*x + a)*B*a^2*b^3*c*d^4*f*g*n/(d*x + c) - 18*(b*x + a)^2*B*a*b^3*c^2*d^4*f*g*n/(d*x + c)^2 + 12*(b*x + a)*B*a
^3*b^2*d^5*f*g*n/(d*x + c) + 18*(b*x + a)^2*B*a^2*b^2*c*d^5*f*g*n/(d*x + c)^2 - 6*(b*x + a)^2*B*a^3*b*d^6*f*g*
n/(d*x + c)^2 - 3*B*b^6*c^4*g^2*n + 6*B*a*b^5*c^3*d*g^2*n + 7*(b*x + a)*B*b^5*c^4*d*g^2*n/(d*x + c) - 16*(b*x
+ a)*B*a*b^4*c^3*d^2*g^2*n/(d*x + c) - 4*(b*x + a)^2*B*b^4*c^4*d^2*g^2*n/(d*x + c)^2 - 6*B*a^3*b^3*c*d^3*g^2*n
+ 6*(b*x + a)*B*a^2*b^3*c^2*d^3*g^2*n/(d*x + c) + 10*(b*x + a)^2*B*a*b^3*c^3*d^3*g^2*n/(d*x + c)^2 + 3*B*a^4*
b^2*d^4*g^2*n + 8*(b*x + a)*B*a^3*b^2*c*d^4*g^2*n/(d*x + c) - 6*(b*x + a)^2*B*a^2*b^2*c^2*d^4*g^2*n/(d*x + c)^
2 - 5*(b*x + a)*B*a^4*b*d^5*g^2*n/(d*x + c) - 2*(b*x + a)^2*B*a^3*b*c*d^5*g^2*n/(d*x + c)^2 + 2*(b*x + a)^2*B*
a^4*d^6*g^2*n/(d*x + c)^2 - 6*A*b^6*c^2*d^2*f^2 - 6*B*b^6*c^2*d^2*f^2 + 12*A*a*b^5*c*d^3*f^2 + 12*B*a*b^5*c*d^
3*f^2 + 12*(b*x + a)*A*b^5*c^2*d^3*f^2/(d*x + c) + 12*(b*x + a)*B*b^5*c^2*d^3*f^2/(d*x + c) - 6*A*a^2*b^4*d^4*
f^2 - 6*B*a^2*b^4*d^4*f^2 - 24*(b*x + a)*A*a*b^4*c*d^4*f^2/(d*x + c) - 24*(b*x + a)*B*a*b^4*c*d^4*f^2/(d*x + c
) - 6*(b*x + a)^2*A*b^4*c^2*d^4*f^2/(d*x + c)^2 - 6*(b*x + a)^2*B*b^4*c^2*d^4*f^2/(d*x + c)^2 + 12*(b*x + a)*A
*a^2*b^3*d^5*f^2/(d*x + c) + 12*(b*x + a)*B*a^2*b^3*d^5*f^2/(d*x + c) + 12*(b*x + a)^2*A*a*b^3*c*d^5*f^2/(d*x
+ c)^2 + 12*(b*x + a)^2*B*a*b^3*c*d^5*f^2/(d*x + c)^2 - 6*(b*x + a)^2*A*a^2*b^2*d^6*f^2/(d*x + c)^2 - 6*(b*x +
a)^2*B*a^2*b^2*d^6*f^2/(d*x + c)^2 + 6*A*b^6*c^3*d*f*g + 6*B*b^6*c^3*d*f*g - 6*A*a*b^5*c^2*d^2*f*g - 6*B*a*b^
5*c^2*d^2*f*g - 18*(b*x + a)*A*b^5*c^3*d^2*f*g/(d*x + c) - 18*(b*x + a)*B*b^5*c^3*d^2*f*g/(d*x + c) - 6*A*a^2*
b^4*c*d^3*f*g - 6*B*a^2*b^4*c*d^3*f*g + 30*(b*x + a)*A*a*b^4*c^2*d^3*f*g/(d*x + c) + 30*(b*x + a)*B*a*b^4*c^2*
d^3*f*g/(d*x + c) + 12*(b*x + a)^2*A*b^4*c^3*d^3*f*g/(d*x + c)^2 + 12*(b*x + a)^2*B*b^4*c^3*d^3*f*g/(d*x + c)^
2 + 6*A*a^3*b^3*d^4*f*g + 6*B*a^3*b^3*d^4*f*g - 6*(b*x + a)*A*a^2*b^3*c*d^4*f*g/(d*x + c) - 6*(b*x + a)*B*a^2*
b^3*c*d^4*f*g/(d*x + c) - 24*(b*x + a)^2*A*a*b^3*c^2*d^4*f*g/(d*x + c)^2 - 24*(b*x + a)^2*B*a*b^3*c^2*d^4*f*g/
(d*x + c)^2 - 6*(b*x + a)*A*a^3*b^2*d^5*f*g/(d*x + c) - 6*(b*x + a)*B*a^3*b^2*d^5*f*g/(d*x + c) + 12*(b*x + a)
^2*A*a^2*b^2*c*d^5*f*g/(d*x + c)^2 + 12*(b*x + a)^2*B*a^2*b^2*c*d^5*f*g/(d*x + c)^2 - 2*A*b^6*c^4*g^2 - 2*B*b^
6*c^4*g^2 + 2*A*a*b^5*c^3*d*g^2 + 2*B*a*b^5*c^3*d*g^2 + 6*(b*x + a)*A*b^5*c^4*d*g^2/(d*x + c) + 6*(b*x + a)*B*
b^5*c^4*d*g^2/(d*x + c) - 6*(b*x + a)*A*a*b^4*c^3*d^2*g^2/(d*x + c) - 6*(b*x + a)*B*a*b^4*c^3*d^2*g^2/(d*x + c
) - 6*(b*x + a)^2*A*b^4*c^4*d^2*g^2/(d*x + c)^2 - 6*(b*x + a)^2*B*b^4*c^4*d^2*g^2/(d*x + c)^2 + 2*A*a^3*b^3*c*
d^3*g^2 + 2*B*a^3*b^3*c*d^3*g^2 - 6*(b*x + a)*A*a^2*b^3*c^2*d^3*g^2/(d*x + c) - 6*(b*x + a)*B*a^2*b^3*c^2*d^3*
g^2/(d*x + c) + 12*(b*x + a)^2*A*a*b^3*c^3*d^3*g^2/(d*x + c)^2 + 12*(b*x + a)^2*B*a*b^3*c^3*d^3*g^2/(d*x + c)^
2 - 2*A*a^4*b^2*d^4*g^2 - 2*B*a^4*b^2*d^4*g^2 + 6*(b*x + a)*A*a^3*b^2*c*d^4*g^2/(d*x + c) + 6*(b*x + a)*B*a^3*
b^2*c*d^4*g^2/(d*x + c) - 6*(b*x + a)^2*A*a^2*b^2*c^2*d^4*g^2/(d*x + c)^2 - 6*(b*x + a)^2*B*a^2*b^2*c^2*d^4*g^
2/(d*x + c)^2)/(b^5*d^3 - 3*(b*x + a)*b^4*d^4/(d*x + c) + 3*(b*x + a)^2*b^3*d^5/(d*x + c)^2 - (b*x + a)^3*b^2*
d^6/(d*x + c)^3) + 2*(3*B*b^4*c^2*d^2*f^2*n - 6*B*a*b^3*c*d^3*f^2*n + 3*B*a^2*b^2*d^4*f^2*n - 3*B*b^4*c^3*d*f*
g*n + 3*B*a*b^3*c^2*d^2*f*g*n + 3*B*a^2*b^2*c*d^3*f*g*n - 3*B*a^3*b*d^4*f*g*n + B*b^4*c^4*g^2*n - B*a*b^3*c^3*
d*g^2*n - B*a^3*b*c*d^3*g^2*n + B*a^4*d^4*g^2*n)*log(b - (b*x + a)*d/(d*x + c))/(b^3*d^3) - 2*(3*B*b^4*c^2*d^2
*f^2*n - 6*B*a*b^3*c*d^3*f^2*n + 3*B*a^2*b^2*d^4*f^2*n - 3*B*b^4*c^3*d*f*g*n + 3*B*a*b^3*c^2*d^2*f*g*n + 3*B*a
^2*b^2*c*d^3*f*g*n - 3*B*a^3*b*d^4*f*g*n + B*b^4*c^4*g^2*n - B*a*b^3*c^3*d*g^2*n - B*a^3*b*c*d^3*g^2*n + B*a^4
*d^4*g^2*n)*log((b*x + a)/(d*x + c))/(b^3*d^3))*(b*c/(b*c - a*d)^2 - a*d/(b*c - a*d)^2)
________________________________________________________________________________________
maple [F] time = 0.27, size = 0, normalized size = 0.00 \[ \int \left (g x +f \right )^{2} \left (B \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right )+A \right )\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
int((g*x+f)^2*(B*ln(e*((b*x+a)/(d*x+c))^n)+A),x)
[Out]
int((g*x+f)^2*(B*ln(e*((b*x+a)/(d*x+c))^n)+A),x)
________________________________________________________________________________________
maxima [A] time = 0.89, size = 282, normalized size = 1.80 \[ \frac {1}{3} \, B g^{2} x^{3} \log \left (e {\left (\frac {b x}{d x + c} + \frac {a}{d x + c}\right )}^{n}\right ) + \frac {1}{3} \, A g^{2} x^{3} + B f g x^{2} \log \left (e {\left (\frac {b x}{d x + c} + \frac {a}{d x + c}\right )}^{n}\right ) + A f g x^{2} + \frac {1}{6} \, B g^{2} n {\left (\frac {2 \, a^{3} \log \left (b x + a\right )}{b^{3}} - \frac {2 \, c^{3} \log \left (d x + c\right )}{d^{3}} - \frac {{\left (b^{2} c d - a b d^{2}\right )} x^{2} - 2 \, {\left (b^{2} c^{2} - a^{2} d^{2}\right )} x}{b^{2} d^{2}}\right )} - B f g n {\left (\frac {a^{2} \log \left (b x + a\right )}{b^{2}} - \frac {c^{2} \log \left (d x + c\right )}{d^{2}} + \frac {{\left (b c - a d\right )} x}{b d}\right )} + B f^{2} n {\left (\frac {a \log \left (b x + a\right )}{b} - \frac {c \log \left (d x + c\right )}{d}\right )} + B f^{2} x \log \left (e {\left (\frac {b x}{d x + c} + \frac {a}{d x + c}\right )}^{n}\right ) + A f^{2} x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((g*x+f)^2*(A+B*log(e*((b*x+a)/(d*x+c))^n)),x, algorithm="maxima")
[Out]
1/3*B*g^2*x^3*log(e*(b*x/(d*x + c) + a/(d*x + c))^n) + 1/3*A*g^2*x^3 + B*f*g*x^2*log(e*(b*x/(d*x + c) + a/(d*x
+ c))^n) + A*f*g*x^2 + 1/6*B*g^2*n*(2*a^3*log(b*x + a)/b^3 - 2*c^3*log(d*x + c)/d^3 - ((b^2*c*d - a*b*d^2)*x^
2 - 2*(b^2*c^2 - a^2*d^2)*x)/(b^2*d^2)) - B*f*g*n*(a^2*log(b*x + a)/b^2 - c^2*log(d*x + c)/d^2 + (b*c - a*d)*x
/(b*d)) + B*f^2*n*(a*log(b*x + a)/b - c*log(d*x + c)/d) + B*f^2*x*log(e*(b*x/(d*x + c) + a/(d*x + c))^n) + A*f
^2*x
________________________________________________________________________________________
mupad [B] time = 4.18, size = 371, normalized size = 2.36 \[ x^2\,\left (\frac {3\,A\,a\,d\,g^2+3\,A\,b\,c\,g^2+6\,A\,b\,d\,f\,g+B\,a\,d\,g^2\,n-B\,b\,c\,g^2\,n}{6\,b\,d}-\frac {A\,g^2\,\left (3\,a\,d+3\,b\,c\right )}{6\,b\,d}\right )-x\,\left (\frac {\left (3\,a\,d+3\,b\,c\right )\,\left (\frac {3\,A\,a\,d\,g^2+3\,A\,b\,c\,g^2+6\,A\,b\,d\,f\,g+B\,a\,d\,g^2\,n-B\,b\,c\,g^2\,n}{3\,b\,d}-\frac {A\,g^2\,\left (3\,a\,d+3\,b\,c\right )}{3\,b\,d}\right )}{3\,b\,d}-\frac {3\,A\,a\,c\,g^2+3\,A\,b\,d\,f^2+6\,A\,a\,d\,f\,g+6\,A\,b\,c\,f\,g+3\,B\,a\,d\,f\,g\,n-3\,B\,b\,c\,f\,g\,n}{3\,b\,d}+\frac {A\,a\,c\,g^2}{b\,d}\right )+\ln \left (e\,{\left (\frac {a+b\,x}{c+d\,x}\right )}^n\right )\,\left (B\,f^2\,x+B\,f\,g\,x^2+\frac {B\,g^2\,x^3}{3}\right )+\frac {A\,g^2\,x^3}{3}+\frac {\ln \left (a+b\,x\right )\,\left (B\,n\,a^3\,g^2-3\,B\,n\,a^2\,b\,f\,g+3\,B\,n\,a\,b^2\,f^2\right )}{3\,b^3}-\frac {\ln \left (c+d\,x\right )\,\left (B\,n\,c^3\,g^2-3\,B\,n\,c^2\,d\,f\,g+3\,B\,n\,c\,d^2\,f^2\right )}{3\,d^3} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
int((f + g*x)^2*(A + B*log(e*((a + b*x)/(c + d*x))^n)),x)
[Out]
x^2*((3*A*a*d*g^2 + 3*A*b*c*g^2 + 6*A*b*d*f*g + B*a*d*g^2*n - B*b*c*g^2*n)/(6*b*d) - (A*g^2*(3*a*d + 3*b*c))/(
6*b*d)) - x*(((3*a*d + 3*b*c)*((3*A*a*d*g^2 + 3*A*b*c*g^2 + 6*A*b*d*f*g + B*a*d*g^2*n - B*b*c*g^2*n)/(3*b*d) -
(A*g^2*(3*a*d + 3*b*c))/(3*b*d)))/(3*b*d) - (3*A*a*c*g^2 + 3*A*b*d*f^2 + 6*A*a*d*f*g + 6*A*b*c*f*g + 3*B*a*d*
f*g*n - 3*B*b*c*f*g*n)/(3*b*d) + (A*a*c*g^2)/(b*d)) + log(e*((a + b*x)/(c + d*x))^n)*((B*g^2*x^3)/3 + B*f^2*x
+ B*f*g*x^2) + (A*g^2*x^3)/3 + (log(a + b*x)*(B*a^3*g^2*n + 3*B*a*b^2*f^2*n - 3*B*a^2*b*f*g*n))/(3*b^3) - (log
(c + d*x)*(B*c^3*g^2*n + 3*B*c*d^2*f^2*n - 3*B*c^2*d*f*g*n))/(3*d^3)
________________________________________________________________________________________
sympy [A] time = 70.52, size = 1027, normalized size = 6.54 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((g*x+f)**2*(A+B*ln(e*((b*x+a)/(d*x+c))**n)),x)
[Out]
Piecewise(((A + B*log(e*(a/c)**n))*(f**2*x + f*g*x**2 + g**2*x**3/3), Eq(b, 0) & Eq(d, 0)), (A*f**2*x + A*f*g*
x**2 + A*g**2*x**3/3 + B*a**3*g**2*n*log(a/c + b*x/c)/(3*b**3) - B*a**2*f*g*n*log(a/c + b*x/c)/b**2 - B*a**2*g
**2*n*x/(3*b**2) + B*a*f**2*n*log(a/c + b*x/c)/b + B*a*f*g*n*x/b + B*a*g**2*n*x**2/(6*b) + B*f**2*n*x*log(a/c
+ b*x/c) - B*f**2*n*x + B*f**2*x*log(e) + B*f*g*n*x**2*log(a/c + b*x/c) - B*f*g*n*x**2/2 + B*f*g*x**2*log(e) +
B*g**2*n*x**3*log(a/c + b*x/c)/3 - B*g**2*n*x**3/9 + B*g**2*x**3*log(e)/3, Eq(d, 0)), (A*f**2*x + A*f*g*x**2
+ A*g**2*x**3/3 - B*c**3*g**2*n*log(c + d*x)/(3*d**3) + B*c**2*f*g*n*log(c + d*x)/d**2 + B*c**2*g**2*n*x/(3*d*
*2) - B*c*f**2*n*log(c + d*x)/d - B*c*f*g*n*x/d - B*c*g**2*n*x**2/(6*d) + B*f**2*n*x*log(a) - B*f**2*n*x*log(c
+ d*x) + B*f**2*n*x + B*f**2*x*log(e) + B*f*g*n*x**2*log(a) - B*f*g*n*x**2*log(c + d*x) + B*f*g*n*x**2/2 + B*
f*g*x**2*log(e) + B*g**2*n*x**3*log(a)/3 - B*g**2*n*x**3*log(c + d*x)/3 + B*g**2*n*x**3/9 + B*g**2*x**3*log(e)
/3, Eq(b, 0)), (A*f**2*x + A*f*g*x**2 + A*g**2*x**3/3 + B*a**3*g**2*n*log(a/(c + d*x) + b*x/(c + d*x))/(3*b**3
) + B*a**3*g**2*n*log(c/d + x)/(3*b**3) - B*a**2*f*g*n*log(a/(c + d*x) + b*x/(c + d*x))/b**2 - B*a**2*f*g*n*lo
g(c/d + x)/b**2 - B*a**2*g**2*n*x/(3*b**2) + B*a*f**2*n*log(a/(c + d*x) + b*x/(c + d*x))/b + B*a*f**2*n*log(c/
d + x)/b + B*a*f*g*n*x/b + B*a*g**2*n*x**2/(6*b) - B*c**3*g**2*n*log(c/d + x)/(3*d**3) + B*c**2*f*g*n*log(c/d
+ x)/d**2 + B*c**2*g**2*n*x/(3*d**2) - B*c*f**2*n*log(c/d + x)/d - B*c*f*g*n*x/d - B*c*g**2*n*x**2/(6*d) + B*f
**2*n*x*log(a/(c + d*x) + b*x/(c + d*x)) + B*f**2*x*log(e) + B*f*g*n*x**2*log(a/(c + d*x) + b*x/(c + d*x)) + B
*f*g*x**2*log(e) + B*g**2*n*x**3*log(a/(c + d*x) + b*x/(c + d*x))/3 + B*g**2*x**3*log(e)/3, True))
________________________________________________________________________________________